package com.aimaterials.resource.service.impl;

import java.util.List;
import com.aimaterials.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aimaterials.resource.mapper.ResCourseMapper;
import com.aimaterials.resource.domain.ResCourse;
import com.aimaterials.resource.service.IResCourseService;

/**
 * 课程信息Service业务层处理
 * 
 * @author DaemonSu
 * @date 2020-11-04
 */
@Service
public class ResCourseServiceImpl implements IResCourseService 
{
    @Autowired
    private ResCourseMapper resCourseMapper;

    /**
     * 查询课程信息
     * 
     * @param courseId 课程信息ID
     * @return 课程信息
     */
    @Override
    public ResCourse selectResCourseById(String courseId)
    {
        return resCourseMapper.selectResCourseById(courseId);
    }

    /**
     * 查询课程信息列表
     * 
     * @param resCourse 课程信息
     * @return 课程信息
     */
    @Override
    public List<ResCourse> selectResCourseList(ResCourse resCourse)
    {
        return resCourseMapper.selectResCourseList(resCourse);
    }

    /**
     * 新增课程信息
     * 
     * @param resCourse 课程信息
     * @return 结果
     */
    @Override
    public int insertResCourse(ResCourse resCourse)
    {
        resCourse.setCreateTime(DateUtils.getNowDate());
        return resCourseMapper.insertResCourse(resCourse);
    }

    /**
     * 修改课程信息
     * 
     * @param resCourse 课程信息
     * @return 结果
     */
    @Override
    public int updateResCourse(ResCourse resCourse)
    {
        resCourse.setUpdateTime(DateUtils.getNowDate());
        return resCourseMapper.updateResCourse(resCourse);
    }

    /**
     * 批量删除课程信息
     * 
     * @param courseIds 需要删除的课程信息ID
     * @return 结果
     */
    @Override
    public int deleteResCourseByIds(String[] courseIds)
    {
        return resCourseMapper.deleteResCourseByIds(courseIds);
    }

    /**
     * 删除课程信息信息
     * 
     * @param courseId 课程信息ID
     * @return 结果
     */
    @Override
    public int deleteResCourseById(String courseId)
    {
        return resCourseMapper.deleteResCourseById(courseId);
    }
}
